{include file="public_tpl/head"/}
<title>内容管理 - 文章添加 - {$cfg_website}</title>
<meta name="keywords" content="{$cfg_keywords?:''}">
<meta name="description" content="{$cfg_description?:''}">
<link rel="stylesheet" href="__STATIC__/editor/css/editormd.css">
</head>
<body>
<!--面包屑-->
<nav class="breadcrumb">
    <i class="Hui-iconfont">&#xe67f;</i> 首页
    <span class="c-gray en">&gt;</span> 内容管理
    <span class="c-gray en">&gt;</span> 文章添加
    <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px"
       href="javascript:location.replace(location.href);" title="刷新">
        <i class="Hui-iconfont">&#xe68f;</i>
    </a>
</nav>
<!--/面包屑-->

<div class="page-container">
    <form action="{:url('edit')}" method="post" class="form form-horizontal" id="form-admin-role-add">
        <div class="row cl">
        <table>
            <tbody>
            <tr style="padding: 20px auto">
                <td><label class="form-label "><span class="c-red">*</span>文章标题：</label></td>
                <td>
                    <input type="hidden" id="article_id" name="article_id" value="{$item.article_id}">
                    <input type="text" class="input-text " value="{$item.title}" placeholder="" id="title" name="title">
                </td>
                <td><label class="form-label"><span class="c-red">*</span>文章分类：</label></td>
                <td>
                    <select type="text" class="input-text " id="cate_id" name="cate_id"></select>
                </td>
            </tr>
            <tr><td colspan="4">&nbsp;</td></tr>
            <tr style="margin: 20px auto">
                <td><label class="form-label "><span class="c-red">*</span>文章标签：</label></td>
                <td colspan="3">
                    <input type="text" class="input-text " value="{$item.tags}" placeholder="半角逗号分隔" id="tags" name="tags">
                </td>
                <!--<td><label class="form-label"><span class="c-red">*</span>缩略图：</label></td>
                <td>
                    <input type="text" class="input-text " value="" placeholder="" id="thumb" name="thumb">
                </td>-->
            </tr>
            <tr><td colspan="4">&nbsp;</td></tr>
            </tbody>
        </table>
        </div>
        <div class="" id="editormd" style=";">
            <textarea name="content" style="display:none;">{$item.content}</textarea>
        </div>
        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                <button type="submit" class="btn btn-success radius"><i class="icon-ok"></i> 确定</button>
            </div>
        </div>
    </form>
</div>
{include file="public_tpl/script"/}
<script src="__STATIC__/editor/editormd.js"></script>

<script>
    $(function () {
        var editor = editormd("editormd", {
            path : "__STATIC__/editor/lib/" // Autoload modules mode, codemirror, marked... dependents libs path
        });
        $("#editormd").height($(window).height()-243);
        $("#cate_id").load('{:url("admin/get.api/categorys")}',function () {
        	$(this).val("{$item->getData('cate_id')}");
        });
    });
</script>
</body>
</html>